package com.zzptc.sky.bdsjws.activites;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RadioButton;

import com.zzptc.sky.bdsjws.R;
import com.zzptc.sky.bdsjws.activites.base.BaseActivity;

import butterknife.BindView;

public class WelcomeActivity extends BaseActivity {

    @BindView(R.id.activity_welcome)
    RadioButton activityWelcome;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public int getContentView() {
        return R.layout.activity_welcome;
    }

    @Override
    public void initData() {

    }

    @Override
    public void initView() {
        ObjectAnimator animator = ObjectAnimator.ofFloat(activityWelcome, "alpha", 1.0f, 0.0f);
        animator.setDuration(3000);
        animator.start();
        animator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                //跳转到主页面
                startActivity(new Intent(WelcomeActivity.this,MainActivity.class));
                overridePendingTransition(R.anim.int_to_right,R.anim.stop_to_center);
                finish();

            }
        });
    }
}
